uninit: remove unncessary ExistSuccess
authorJoey Hess <joeyh@joeyh.name>
Thu, 11 May 2023 17:50:20 +0000 (13:50 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 11 May 2023 17:50:20 +0000 (13:50 -0400)
That was added in 2011 to prevent writing to the git-annex branch on
shutdown. But, the use of saveState causes pending git-annex branch
writes to be completed before the branch is deleted. So, an unusual exit
is not needed.

Command/Uninit.hs

index 59b8f2845b22c129493dfc7eb33d9f168f3ab608..a26cb129fb57b2fc7c483f94bb7c48529a420aea 100644 (file)
@@ -54,8 +54,7 @@ seek = withNothing $ do
                        withFilesInGitAnnex ww (Command.Unannex.seeker True)
                                =<< workTreeItems ww []
                        whenM (checkok False $ commandAction $ removeAnnexDir recordok) $ 
-                               whenM (checkok False $ commandAction $ completeUnitialize recordok) $
-                                       liftIO exitSuccess
+                               commandAction completeUnitialize
   where
        ww = WarnUnmatchLsFiles "uninit"
        checksymlinks recordnotok (_, f) = 
@@ -163,12 +162,12 @@ removeUnannexed = go []
                s <- R.getFileStatus f
                return $ linkCount s > 1
 
-completeUnitialize :: CommandCleanup -> CommandStart
-completeUnitialize recordok =
+completeUnitialize :: CommandStart
+completeUnitialize =
        starting ("uninit finish") (ActionItemOther Nothing) (SeekInput []) $ do
                uninitialize
                removeAnnexBranch
-               next recordok
+               next $ return True
 
 removeAnnexBranch :: Annex ()
 removeAnnexBranch = do